var baseUrl="http://api.gejinnet.com";
function u_post(url,param,callback){
    $.ajax({
        url: baseUrl+url,
        type: 'post',
        data: param,
        headers: {
            "Token":sessionStorage.getItem('token'),
            'Content-Type': 'application/x-www-form-urlencoded'  //multipart/form-data;boundary=--xxxxxxx   application/json
        },
        success: function(res){
            callback(res)
        },
        error: function(e) {

        }
    });
}
function u_get(url,param,callback){
    $.ajax({
        url: baseUrl+url,
        type: 'get',
        data: param,
        headers: {
            "Token":sessionStorage.getItem('token'),
            'Content-Type': 'application/x-www-form-urlencoded'  //multipart/form-data;boundary=--xxxxxxx   application/json
        },
        success: function(res){
            callback(res)
        },
        error: function(e) {

        }
    });
}

function getQueryString(name) {
    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
    var r = window.location.search.substr(1).match(reg);
    if (r != null) {
        return unescape(r[2]);
    }
    return null;
}

var utc2datetime=function (utc_datetime) {
    if(utc_datetime.substr(0,4)=="0001") return ""
    return utc_datetime.replace(/T|Z/g, " ").replace(/\+08\:00/, "")
}

var unix2datetime=function(unix_datetime){
    var unixTimestamp = new Date(unix_datetime * 1000)
    commonTime = unixTimestamp.toLocaleString()
    return commonTime
}